/**
 * Created by liujz on 3/6/17.
 */

var Person = require('./person').Person;

class Teacher extends Person{
    constructor(name,age,klass){
        super(name,age);
        this.klass = klass;
    }

    introduce() {
        return super.introduce() + ' I am a Teacher. I teach ' + (this.klass ? 'Class ' + this.klass.num : 'no Class') + '.';
    }

    introduceWith(student){
        return super.introduce() + ' I am a Teacher. I ' + (this.klass.num === student.klass.num?'':"don't ") + 'teach ' + student.name+ '.';
    }
}

module.exports.Teacher = Teacher;